package com.systop.supervise.mapper;
import com.systop.common.pojo.course_library;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface CourselibraryMapper {


        /*
     * 修改course_library课程
     * course_library course_library
     * return int
     * csh
     * */
    @Update(
            "update course_library set course_name = #{course_name},college_name = #{college_name},performance_rule_id = #{performance_rule_id},class_hour = #{class_hour},credit = #{credit},course_group_name = #{course_group_name},introduction = #{introduction},remark = #{remark} where course_id = #{course_id}"
    )
    int updataCourse_library(course_library c);


    //"time = #{time,jdbcType=TIMESTAMP} "  时间类型

    /*
     * 添加course_library课程
     * course_library course_library
     * return int
     * csh
     * */
    @Insert("insert into course_library(course_id,course_name,college_name,performance_rule_id,class_hour,credit,course_group_name,introduction,remark) values(#{course_id},#{course_name},#{college_name},#{performance_rule_id},#{class_hour},#{credit},#{course_group_name},#{introduction},#{remark})")
    int insertCourse_library(course_library c);

    /*
     * 查看全部
     * 无
     * list
     * csh
     * */
    @Select("select * from course_library")
    List<course_library> sourse_libraryList();

    /*
     * 用tno查看course_library
     * int tno
     * list
     * csh
     * */
    @Select("select * from course_library where course_id = #{course_id}")
    List<course_library> course_libraryIdlist(int course_id);

    /*
     * 删除course_library
     * int tno
     * return int
     * csh
     * */
    @Delete("delete from course_library where course_id=#{course_id}")
    int deleteCourse_library(int course_id);


}
